package de.baumann.browser.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import android.widget.TextView
import de.baumann.browser.R
import de.baumann.browser.api.net.vo.gg.Smelter

class SpSmelterAdapter(var context: Context,var list:List<Smelter>) :BaseAdapter(){
    override fun getView(p0: Int, p1: View?, p2: ViewGroup?): View {
        val view = LayoutInflater.from(context).inflate(R.layout.item_sp_smelter, p2, false)
        if (view != null) {
            val smelterName: TextView = view.findViewById(R.id.spSmelterName)
            smelterName.text = list[p0].name
        }
        return view
    }

    override fun getItem(p0: Int): Any {
        return list[p0]
    }

    override fun getItemId(p0: Int): Long {
        return p0.toLong()
    }

    override fun getCount(): Int {
        return list.size
    }

}